﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>常用JS</title>
    <style type="text/css">
        body > div {
            border: 1px solid #777;
            padding: 6px;
        }
    </style>
    <script src="Scripts/jquery-1.4.1.js"></script>
    <script src="Scripts/utils.js"></script>
    <script type="text/javascript">

        function formatDate() {
            var format = $("#dateformat").val();
            var result = (new Date()).format(format);
            print(result);
        }

        function print(result) {
            console.log(result);
            $("#result").append("<p>" + result + "</p>");
        }

        function clearResult() {
            $("#result").empty();
        }

        $(function () {

        });
    </script>
</head>
<body>
    <div>
        日期格式化:<input id="dateformat" type="text" /><a href="javascript:formatDate()">格式化</a>
    </div>
    <div>
        数组查找:
    </div>
    <br />
    <span>结果:</span><a href="javascript:clearResult();">清空</a>
    <div id="result">
    </div>
</body>
</html>
